package com.yuanfeng.business.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;

/**
 * 店铺等级表
 * @TableName shop_member_grade_set
 */
@TableName(value ="shop_member_grade_set")
@Data
public class ShopMemberGradeSetEntity implements Serializable {
    /**
     * id
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 会员等级id
     */
    private Integer gradeId;

    /**
     * 会员等级规则
     */
    private String gradeRule;

    /**
     * 会员等级折扣
     */
    private Integer gradeDiscount;

    /**
     * 店铺id
     */
    private Integer shopId;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ShopMemberGradeSetEntity other = (ShopMemberGradeSetEntity) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getGradeId() == null ? other.getGradeId() == null : this.getGradeId().equals(other.getGradeId()))
            && (this.getGradeRule() == null ? other.getGradeRule() == null : this.getGradeRule().equals(other.getGradeRule()))
            && (this.getGradeDiscount() == null ? other.getGradeDiscount() == null : this.getGradeDiscount().equals(other.getGradeDiscount()))
            && (this.getShopId() == null ? other.getShopId() == null : this.getShopId().equals(other.getShopId()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getGradeId() == null) ? 0 : getGradeId().hashCode());
        result = prime * result + ((getGradeRule() == null) ? 0 : getGradeRule().hashCode());
        result = prime * result + ((getGradeDiscount() == null) ? 0 : getGradeDiscount().hashCode());
        result = prime * result + ((getShopId() == null) ? 0 : getShopId().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", gradeId=").append(gradeId);
        sb.append(", gradeRule=").append(gradeRule);
        sb.append(", gradeDiscount=").append(gradeDiscount);
        sb.append(", shopId=").append(shopId);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}